//
// Created by Thinkpad on 2025/11/18.
//

#include <iostream>
#include <string>

using namespace std;

int main() {
    // 统计单词个数
    string s;
    bool isSpace = true;
    int sum = 0;
    getline(cin, s);
    for (int i = 0; i < s.length(); i++) {
        if (s[i] == ' ') {
            isSpace = true;
        } else if (isSpace) {
            sum++;
            isSpace = false;
        }
    }
    return 0;
}
